<template>
	<view class="addressList">
		<scroll-view scroll-y :show-scrollbar="false" class="swiper" style="background-color: #F9F9F9;">

			<fui-radio-group name="radio" v-model="val" @change="change">
				<view class="fui-list__item">
					<fui-label v-for="(item,index) in 5" :key="index">
						<view class="addressBox flex-js">
							<view class="iconBox">
								<fui-radio :value="index" checked></fui-radio>
							</view>
							<view class="addressMsg">
								<view class="address">
									河北省保定市清苑区河北省保定市清苑区河北省保定市清苑区
								</view>
								<view class="" style="font-size: 28rpx;color: #999999;">
									宋佳伟 11111111111
								</view>
							</view>
							<view class="iconBox" @click.stop="editAddress">
								<fui-icon name="edit" size="50"></fui-icon>
							</view>
						</view>
					</fui-label>
				</view>
			</fui-radio-group>

		</scroll-view>
		<view class="buyBox" :style="{'bottom':bottomHight+'rpx'}">
			<view class="btn flex">
				新增地址
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bottomHight: 0,
			};
		},
		mounted() {
			let app = uni.getSystemInfoSync()
			this.bottomHight = app.safeAreaInsets.bottom
			console.log('app', app);
		},
		methods: {
			editAddress() {
				uni.navigateTo({
					url: '/myPages/editAddress'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	view {
		box-sizing: border-box;
	}

	.addressBox {
		text-align: center;
		border-radius: 30rpx;
		background-color: white;
		padding: 20rpx 10rpx;
		margin-bottom: 20rpx;
	}

	.iconBox {
		width: 10%;
	}

	.addressMsg {
		text-align: left;
		width: 80%;

		.address {
			font-weight: 600;
			font-size: 30rpx;
			overflow: hidden;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			text-overflow: ellipsis;
			word-break: break-all;
			-webkit-line-clamp: 2;
		}
	}



	.addressList {
		background-color: #F8F8F8;
		width: 100vw;
		height: 100vh;
	}

	.swiper {
		box-sizing: border-box;
		width: 100%;
		padding: 20rpx;
		padding-bottom: 150rpx;
		height: 100%;
	}

	.buyBox {

		background-color: white;
		padding: 20rpx;
		padding-bottom: 50rpx;
		position: fixed;
		left: 0;
		width: 100vw;

		.btn {
			padding: 20rpx 0rpx;
			color: white;
			font-weight: 600;
			justify-content: center;
			border-radius: 60rpx;
			background-color: #f9613e;
		}
	}
</style>